package com.cserver.pro.controller;

import com.cserver.pro.entity.YqBaseinfo;
import com.cserver.pro.service.YqBaseinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 疫情基本信息表(YqBaseinfo)表控制层
 *
 * @author makejava
 * @since 2020-02-19 10:21:29
 */
@RestController
@RequestMapping("yqBaseinfo")
public class YqBaseinfoController {
    /**
     * 服务对象
     */
    @Autowired
    private YqBaseinfoService yqBaseinfoService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public YqBaseinfo selectOne(Long id) {
        return this.yqBaseinfoService.queryById(id);
    }

    @GetMapping("selectMore")
    @ResponseBody
    public List<YqBaseinfo> queryAllByLimit(Long id) {
        return this.yqBaseinfoService.queryAllByLimit(0,5);
    }
}